#pragma once
//#include "mkvcontext.hpp"
#include "mkvstreamvideo.hpp"
#include <vector>

namespace MkvMux
{

class MkvStreamVideoVPx : public MkvStreamVideo
{
    MkvStreamVideoVPx(const MkvStreamVideoVPx&);
    MkvStreamVideoVPx& operator=(const MkvStreamVideoVPx&);
    
public:
    MkvStreamVideoVPx(MkvContext&, const AM_MEDIA_TYPE&);
    
    HRESULT Receive(IMediaSample*);
    int EndOfStream();

protected:

    void WriteTrackName();
    void WriteTrackCodecID();
    void WriteTrackCodecName();
    void WriteTrackSettings();

private:
    
    class VPxFrame : public VideoFrame
    {
        VPxFrame(const VPxFrame&);
        VPxFrame& operator=(const VPxFrame&);
      
    private:
        IMediaSample* const m_pSample;

    public:
        explicit VPxFrame(IMediaSample*);
        ~VPxFrame(); 

        bool IsKey() const;
        ULONG curr_timecode_ms() const;
        ULONG size() const;
        const BYTE* data() const;

    };
    
public:
   
    LONG last_timecode_ms() const;

};

}  //end namespace MkvMux
